% FIGURE1A.M
% Y1=-2.5, Y2=2.5

% (a) n=100 
load uniformT100Y25.txt; x1=uniformT100Y25(:,1);y1=uniformT100Y25(:,2);
load truncatednormalT100Y25.txt; y2=truncatednormalT100Y25(:,2); x2=truncatednormalT100Y25(:,1);
load informative1T100Y25.txt; y3=informative1T100Y25(:,2); x3=informative1T100Y25(:,1);
load informative2T100Y25.txt; y4=informative2T100Y25(:,2); x4=informative2T100Y25(:,1);

subplot(2,1,1)
plot(x1,y1,'k-',x2,y2,'k-.',x3,y3,'--',x4,y4,':','linewidth',3)
axis([-3 3 0 5])
legend('Prior 1','Prior 2','Prior 3','Prior 4')
grid on
title('n = 100')

% (b) n= infinity
load uniformTinftyY25.txt; x1=uniformTinftyY25(:,1); y1=uniformTinftyY25(:,2); y1(1:10,1)=NaN*ones(10,1); y1(end-10+1:end,1)=NaN*ones(10,1);
load truncatednormalTinftyY25.txt; y2=truncatednormalTinftyY25(:,2); x2=truncatednormalTinftyY25(:,1); y2(1:10,1)=NaN*ones(10,1); y2(end-10+1:end,1)=NaN*ones(10,1);

% The informative priors are discrete probability disributions for n=infty:
% Informative prior 1: Vertical line at -2.5 of height 0.99, at +2.5 of
% height 0.01 (line manually changed to dotted line)
% Informative prior 2: Vertical line at -2.5 of height 0.01, at +2.5 of height 0.99.
% For expository purposes we just put a vertical line where the 0.99 probability mass is.

subplot(2,1,2)
plot(x1,y1,'k-',x2,y2,'k-.','linewidth',3)
line([-2.5 -2.5],[0 1],'linewidth',3) % vertical line to be changed manually to dashed line
line([2.5 2.5],[0 1],'linewidth',3)   % vertical line to be changed manually to dotted line
axis([-3 3 0 1])
legend('Prior 1','Prior 2','Prior 3','Prior 4')
grid on
title('n = \infty')